package practice07;

public class Teacher extends Person{
    private String name;
    private int age;
    private Klass Klass;

    public String introduce(){
        if (Klass==null){
            return super.introduce()+" I am a Teacher. I teach No Class.";
        }else {
            return super.introduce()+" I am a Teacher. I teach Class "+Klass.getNumber()+".";
        }

    }

    public String introduceWith(Student student){
        if (getKlass()==student.getKlass()){
            return super.introduce()+" I am a Teacher. I teach "+student.getName()+".";
        }else {
            return super.introduce()+" I am a Teacher. I don't teach "+student.getName()+".";
        }
    }

    public Teacher(String name, int age) {
        super(name, age);
    }

    public Teacher(String name, int age, Klass klass) {
        super(name, age);
        Klass = klass;
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public int getAge() {
        return super.getAge();
    }

    public Klass getKlass() {
        return Klass;
    }
}
